@model SharedPageVM
@{
    ViewData["Title"] = "Discover docs";
    var rows = Model.Rows as List<Netnr.Blog.Domain.DocSet>;
    var uinfo = Netnr.Blog.Web.Apps.LoginService.Get(ViewContext.HttpContext);

    if (ViewData["Nickname"] != null)
    {
        ViewData["Title"] = ViewData["Nickname"] + " docs";
    }
}

<div class="container-fluid">

    <div class="row mb-3">
        <div class="col-xl-3 col-lg-4 col-md-6">
            <form action="@ViewContext.HttpContext.Request.Path" method="get">
                <input class="form-control form-control-sm" name="q" value='@ViewData["q"]' aria-label="Search" placeholder="Search..." />
            </form>
        </div>
    </div>

    <div class="row">
        @foreach (var item in rows)
        {
            <div class="col-xl-3 col-lg-4 col-md-6 mb-4">
                <div class="card border-success card-pi">
                    <div class="card-body text-success">
                        @if (uinfo.UserId == item.Uid)
                        {
                            <span class="card-tool">
                                <a href="/doc/item/setting/@item.DsCode" class="fa fa-edit" title="编辑"></a>
                                <a href="/doc/item/del/@item.DsCode" class="fa fa-trash-o text-danger" title="删除" onclick="return confirm('确定删除?')"></a>
                                @if (item.DsOpen != 1 && !string.IsNullOrWhiteSpace(item.Spare1))
                                {
                                    <a href="/doc/code/@(item.DsCode+"/?code="+item.Spare1)" target="_blank" class="fa fa-share-alt text-success" title="分享码查看链接"></a>
                                }
                            </span>
                        }
                        <a class="h5 card-title" href="/doc/code/@item.DsCode/">
                            @if (item.DsOpen != 1)
                            {
                                <i class="fa fa-lock text-success mr-1" title="私有"></i>
                            }
                            @item.DsName
                        </a>
                        <p>
                            <i class="fa fa-user text-muted"></i>
                            <a href="/doc/user/@item.Uid">@item.Spare3</a>
                            &nbsp;
                            <span class="text-muted small">@item.DsCreateTime?.ToString("yyyy-MM-dd HH:mm")</span>
                        </p>
                        <div class="text-muted">@(string.IsNullOrWhiteSpace(item.DsRemark) ? "暂无备注" : item.DsRemark)</div>
                    </div>
                </div>
            </div>
        }
    </div>

    <div class="row mt-4">
        <div class="col-12">
            <partial name="_PartialPaging4" />
        </div>
    </div>

</div>